<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Admin_Banner extends Controller {
    
    //保存数据
    public function action_saveInfo(){

        $id=$this->request->post('model_id');

        $description=$this->request->post('description');

        $image=$this->request->post('image');

        $url=$this->request->post('url');

        $sort=$this->request->post('sort');

        $isdisabled=$this->request->post('isdisabled');

        $Model_Admin=new Model_Admin_Banner();

        echo $Model_Admin->saveInfo($id,$description,$url,$image,$sort,$isdisabled);
    }
    //删除数据
    public function action_deleteInfo(){

        $id=$this->request->post('id');

        $Model_Admin=new Model_Admin_Common();

        echo $Model_Admin->deleteInfo("banner",$id);

    }
    //根据id加载数据
    public function action_loadInfoById(){

        $id=$this->request->post('id');
        $sql="select t.bannerid model_id,
        t.description,t.image,t.url,t.sort,t.isdisabled
            from banner t
            where t.bannerid='$id'
            limit 1";

        $Model_Admin=new Model_Admin_Common();
        
        echo $Model_Admin->loadInfoById($sql);
    }
}
?>